Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
STOP condition
Progress supports a
STOPstatement that lets the user terminate or restart your application altogether if an unrecoverable error occurs. You can trap theSTOPcondition in your block header statements as well. TheSTOPcondition occurs when a ProgressSTOPstatement executes or when the user presses the keyboard key mapped to that value. TheSTOPkey, by default, is mapped to CTRL+BREAK in Windows and CTRL+C on UNIX.When the
STOPcondition occurs, by default Progress undoes the current transaction (if any). If the user starts the application from an OpenEdge tool, such as the Procedure Editor, Progress terminates the application and returns to that tool. Otherwise, if the user starts the application using the Startup procedure (-p) startup option on the OpenEdge session, Progress reruns the startup procedure.Progress raises the
STOPcondition when an unrecoverable system error occurs, such as when a database connection is lost or an external procedure that your code runs cannot be found. You cannot put theNO-ERRORcondition on aRUNstatement for an external procedure, as you can for an internal procedure. Therefore, the only way to trap such an error is to put the statement in aDO ON STOPblock such as this:
If the procedure isn’t found you still get an error, as shown in Figure 17–13.
Figure 17–13: Procedure not found error message
![]()
But your procedure continues executing and you can deal with the error, as shown in Figure 17–14.
Figure 17–14: Example message for procedure not found condition
![]()
If you anticipate that this might happen, it is better to use the
SEARCHfunction to determine in advance whether Progress can find the procedure in the current PROPATH:
System and software failures
Following a system hardware or hardware failure that it cannot recover from, Progress undoes any partially completed transactions for all users. This includes any work done in any complete or incomplete subtransaction encompassed within the uncommitted transaction.
If Progress loses a database connection (for example, because a remote server fails), client processing can still continue. In this case, the following actions occur:
- Progress raises the
STOPcondition. For this special instance of theSTOPcondition, you cannot change the default processing. Progress ignores anyON STOPphrases.- Progress deletes any running persistent procedure instances that reference the disconnected database.
- Progress undoes executing blocks, beginning with the innermost active block and working outward. It continues to undo blocks until it reaches a level above all references to tables or sequences in the disconnected database.
- Progress changes to the normal
STOPcondition. From this point on, Progress observes any furtherON STOPphrases it encounters in your procedures.Progress continues to undo blocks until it reaches an
ON STOPphrase. If noON STOPphrase is reached, it undoes all active blocks and restarts the top-level procedure.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |